<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/sncss/css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="__PUBLIC__/admin/sncss/js/jquery.js"></script>
	<script language="javascript" type="text/javascript" src="__PUBLIC__/admin/datepicker/WdatePicker.js"></script>
	<script type="text/javascript">
        //时间选择
        function selecttime(flag){
            if(flag==1){
                var endTime = $("#countTimeend").val();
                if(endTime != ""){
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:endTime});
                }else{
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
                }
            }else{
                var startTime = $("#countTimestart").val();
                if(startTime != ""){
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:startTime});
                }else{
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
                }
            }
        }
	</script>

</head>


<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
		<li><a>首页</a></li>
		<li><a>订单管理</a></li>
		<li><a>新订单列表</a></li>
		<li><a onClick="javascript:history.back(-1);">返回</a></li>
		</ul>
		</div>

		<div class="rightinfo">
		<div class="tools">

		<form id="form1" name="form1" method="get" action="{:U('/Home/Signorder/sendorder_list')}">
			 <!-- Unnamed (下拉列表框) -->

			<div style="float: left;">
				<select class="newselect" id="u1_input" name="soundtype" >
					<option  value="0" <?php if($soundtype == 0){echo "selected='selected'";}?>>全部类型</option>
					<option  value="1" <?php if($soundtype == 1){echo "selected='selected'";}?>>评述讲解</option>
					<option  value="2" <?php if($soundtype == 2){echo "selected='selected'";}?>>情感演绎</option>
					<option  value="3" <?php if($soundtype == 3){echo "selected='selected'";}?>>娱乐互动</option>
					<option  value="4" <?php if($soundtype == 4){echo "selected='selected'";}?>>新闻播报</option>
					<option  value="5" <?php if($soundtype == 5){echo "selected='selected'";}?>>英文播报</option>
				</select>

			<!-- Unnamed (下拉列表框) -->
				<select class="newselect" id="u2_input" name="status" >
					<option  value="0" <?php if($status == 0){echo "selected='selected'";}?>>全部(订单状态)</option>
					<option  value="1" <?php if($status == 1){echo "selected='selected'";}?>>保底待抢</option>
					<option  value="2" <?php if($status == 2){echo "selected='selected'";}?>>保底待交付</option>
					<option  value="3" <?php if($status == 3){echo "selected='selected'";}?>>主播待接单</option>
					<option  value="4" <?php if($status == 4){echo "selected='selected'";}?>>主播未接单</option>
					<option  value="5" <?php if($status == 5){echo "selected='selected'";}?>>主播待交付</option>
					<option  value="6" <?php if($status == 6){echo "selected='selected'";}?>>已交付</option>
					<option  value="10" <?php if($status == 10){echo "selected='selected'";}?>>保底超时未交付</option>
				</select>
			<!-- Unnamed (下拉列表框) -->
				<select class="newselect" id="u3_input" name="statustype" >
					<option  value="0" <?php if($statustype == 0){echo "selected='selected'";}?>>正常(是否异常)</option>
					<option  value="1" <?php if($statustype == 1){echo "selected='selected'";}?>>异常</option>
				</select>
				<select class="newselect" id="u3_input" name="rejecttype" >
					<option  value="0" <?php if($rejecttype == 0){echo "selected='selected'";}?>>全部(是否重传)</option>
					<option  value="1" <?php if($rejecttype == 1){echo "selected='selected'";}?>>重传</option>
				</select>
				<select class="newselect" id="u3_input" name="ordertype" >
					<option  value="0" <?php if($ordertype == 0){echo "selected='selected'";}?>>全部(是否重要)</option>
					<option  value="1" <?php if($ordertype == 1){echo "selected='selected'";}?>>重要</option>
				</select>
				<select class="newselect" id="u3_input" name="sex" >
					<option  value="0" <?php if($sex == 0){echo "selected='selected'";}?>>全部(性别)</option>
					<option  value="1" <?php if($sex == 1){echo "selected='selected'";}?>>男</option>
					<option  value="2" <?php if($sex == 2){echo "selected='selected'";}?>>女</option>
				</select>
				<input name="order_name" type="text" class="dfinput" placeholder="标题/订单编号" id="user" value="<?php echo $order_name;?>" />
				<input name="" type="submit" class="btn" value="搜索"/>
		</div>
		</form>
		<a href="{:U('/Home/Daochu/sendorder')}" style="border:none;width:100px;height:36px; font-size:14px; cursor:pointer; line-height:36px;background:#61afdf;color:#fff;text-align:center;text-indent:0;display:block;float: left;margin-left: 5px;">导出</a>
		</div>
			<div class="tools">
				<form method="post" enctype="multipart/form-data" action="{:U('/Home/Export/sendorder_new')}">
					<input type="text" style="width: 140px;" class="dfinput ordertimebody1" name="start" id="countTimestart" onfocus="selecttime(1)" value="<?php echo date("Y-m-d H:i:s",'');?>" size="17" class="date" readonly> - <input type="text" style="width: 140px;" class="dfinput ordertimebody2" name="end" id="countTimeend" onfocus="selecttime(2)" value="<?php echo date("Y-m-d H:i:s",'');?>" size="17"  class="date" readonly>
					<input name="" type="submit" class="btn" value="导出"/>
				</form>
			</div>
		<table class="tablelist">
			<thead>
			<tr>
				<th width="60">序号</th>
				<th width="120">订单编号</th>
				<th width="200">标题</th>
				<th width="80">类型</th>
				<th width="50">性别</th>
				<th width="60">字数</th>
				<th width="50">重要</th>
				<th width="150">下单时间</th>
				<th width="70">接单主播</th>
				<th width="">订单状态</th>
				<th>操作</th>
				</tr>
				</thead>
				<tbody>

	<foreach name='orderlist' item='v'>
		<tr>
			<td>{$v.id}</td>
			<td>{$v.article_id}</td>
			<td>
				<a href="{:U('/Home/Order/order_edit',array('oid'=>$v['id']))}" class="tablelink" title="{$v.title}" ><?php echo mb_strlen($v['title']) > 14 ? mb_substr($v['title'],0,14, 'utf-8').'...' : $v['title'];?></a></td>
			<td>
				<switch name="v.category" >
				<case value="1">评述讲解</case>
				<case value="2">情感演绎</case>
				<case value="3">娱乐互动</case>
				<case value="4">新闻播报</case>
				<case value="5">英文播报</case>
				<default />未知
				</switch>
			</td>
			<td>
				<switch name="v.sex" >
				<case value="0">全部</case>
				<case value="1">男</case>
				<case value="2">女</case>
				<default />未知
				</switch>
			</td>
			<td>{$v.words}</td>
			<td><if condition="$v.isimportant == 1">是<else />否</if></td>
			<td>{$v.pay_time|date="Y-m-d H:i:s",###}</td>
			<td>{$v.user_id}</td>
			<td>
				<if condition="$v.isreject == 0">
					<if condition="$v.type == 4">
						<switch name="v.status" >
						<case value="1">保底待抢单</case>
						<case value="3">保底待交付</case>
						<case value="5">已交付未结算:{$v.audio_upload_time|date="Y-m-d H:i:s",###}</case>
						<case value="7">已交付已结算:{$v.audio_upload_time|date="Y-m-d H:i:s",###}</case>
						<default />未知
						</switch>
					<else />
						<switch name="v.status" >
						<case value="0">已作废</case>
						<case value="1">待抢单</case>
						<case value="3">待交付</case>
						<case value="5">已交付未结算:{$v.audio_upload_time|date="Y-m-d H:i:s",###}</case>
						<case value="7">已交付已结算:{$v.audio_upload_time|date="Y-m-d H:i:s",###}</case>
						<case value="9">需要重传</case>
						<case value="11">主播未接单</case>
						<case value="13">超时未能完成</case>
						<case value="15">用户主动取消订单</case>
						<default />未知
						</switch>
					</if>
				<else />
					<a title="{$v.passmessage}">需要重传:{$v.passmessage}</a>
				</if>
			</td>
			<td>
			<a href="{:U('/Home/Order/order_edit',array('oid'=>$v['id']))}" class="tablelink">详情</a>
			<!-- <?php if(!empty($v['audio_link'])&&$v['state']==3){?>
			<a href="/Home/Order/order_score?oid=<?php echo $v['id'];?>" class="tablelink">评分</a>
			<a href="javascript:void(0);" onclick="orderpass(<?php echo $v['id'];?>)" class="tablelink">不通过</a>
			<?php }?>
			<?php if(!empty($v['audio_link'])&&$v['state']==4){?>
			<a class="tablelink">已评分</a>
			<?php }?> -->
			<?php if(!empty($v['audio_link'])){?>
			<a class="tablelink" onclick='orderpass("<?php echo $v['article_id'];?>",<?php echo $v['id'];?>)'>重传</a>
			<?php }?>
			</td>
		</tr>
	</foreach>

				</tbody>
		</table>
		<style>.pages a,.pages span {
		display:inline-block;
		padding:2px 5px;
		margin:0 1px;
		border:1px solid #f0f0f0;
		-webkit-border-radius:3px;
		-moz-border-radius:3px;
		border-radius:3px;
}
.pages a,.pages li {
		display:inline-block;
		list-style: none;
		text-decoration:none; color:#58A0D3;
}
.pages a.first,.pages a.prev,.pages a.next,.pages a.end{
		margin:0;
}
.pages a:hover{
		border-color:#50A8E6;
}
.pages span.current{
		background:#50A8E6;
		color:#FFF;
		font-weight:700;
		border-color:#50A8E6;
}</style>

	 <div class="pages"><br />

												<div align="right">{$page}
												</div>
	 </div>

		</div>

		<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>
<script src="__PUBLIC__/js/jquery1.8.3.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<style type="text/css">
.newselect2{
  height:36px;
  line-height:36px;
  border:1px solid #c5c5c5;
  width: 400px;
}
.mainlist{padding:10px;}
</style>
<script type="text/javascript">

function orderpass(article_id,oid){
		layer.open({title: false, type: 1, area: ['600px', '300px'], //宽高
				content: '<div class="mainlist"><form id="form2" name="form2" method="post" action="/Home/Signorder/sendreorder" onsubmit="return form2_submit();">'
				+'<input name="audio_mp3"  id="audio_mp3"  type="hidden" value="" />'
				+'<audio src="" id="ad-bgm" controls="controls">您的浏览器不支持 audio 标签。</audio>'
				+'<div id="container_bgm" style="float: left;"><a class="btn" id="pickfiles_bgm" style="display: block; text-align: center;line-height: 36px;" ><span id="updata_more_audio_finish_bgm">选择文件</span></a></div>'
				+'<input name="article_id"  type="hidden" value="'+article_id+'" />'
				+'<br>主播编号：<input id="anchor_id" name="anchor_id" class="dfinput"  type="text" value="" />'
				+'<input name="oid"  type="hidden" value="'+oid+'" />'
				+'<br><br>主播性别：<input name="sex" type="radio" value="1" />男&nbsp;&nbsp;<input name="sex" type="radio" value="2" />女'
				+'<br><br><br><br><input type="submit" id="overflow" class="btn" value="确认提交"/></form></div>'
		});
		qiniuupload();
}

</script>

<script type="text/javascript" src='__PUBLIC__/admin/Js/plupload.full.min.js'></script>
<script type="text/javascript" src="__PUBLIC__/admin/Js/qiniu.js"></script>
<script type="text/javascript">
	//====================================================================================
	var ADMIN_URL = "<?php echo "http://".ADMIN_URL;?>"
	function qiniuupload(){
		Qiniu.uploader({
			runtimes: 'html5,flash,html4',
			browse_button: 'pickfiles_bgm',
			// HTML中重要的div的ID
			container: 'container_bgm',
			drop_element: 'container_bgm',
			max_file_size: '100mb',
			dragdrop: true,
			chunk_size: '100mb',
			uptoken_url:'http://qiniu.heardtech.com/uptoken2.php',
			domain: 'http://audio.heardtech.com',
			get_new_uptoken: false,
			auto_start:true,
			log_level: 5,
			unique_names: true,
			save_key: false,
			multi_selection: false,  // 禁止同时上传多个文件
			init: {
				'FilesAdded': function(up, file) {
				},
				'BeforeUpload': function(up, file) {
				},
				'UploadProgress': function(up, file) {
					console.log(file.name, file.percent);
					$('#updata_more_audio_finish_bgm').text('正在上传（' + file.percent + '%）');
				},
				'UploadComplete': function(up,file) {
						// console.log("我是七牛",this);
				},
				'FileUploaded': function(up, file, info) {
					// console.log('文件上传完成后！');
					$('#updata_more_audio_finish_bgm').text('上传成功');
					var obj=$.parseJSON(info.response);
					var hash=obj.hash;
					var key=obj.key;
					var persistentId=obj.persistentId;
					$('#audio_mp3').val(key);
					$("#ad-bgm").attr('src',"http://audio.heardtech.com/"+key);
				},
				'Error': function(up, err, errTip) {
						$('#updata_more_audio_finish_bgm').text('上传失败');
				},
				'Key': function(up, file) {

				}
			},
			filters : {
				max_file_size : '100mb',
				mime_types: [
					{title : "Audio files", extensions : "mp3"}// 限定flv,mpg,mpeg,avi,wmv,mov,asf,rm,rmvb,mkv,m4v,mp4后缀格式上传
				]
			}
		});
	}

//=====================================================================================================================================
</script>
<script type="text/javascript">

		function form2_submit(){
			var audio_mp3 = $('#audio_mp3').val();
			if(audio_mp3.length == 0){
				layer.msg('请上传音频');return false;
			}
			var anchor_id = $('#anchor_id').val();
			if(anchor_id.length == 0){
				layer.msg('请填主播id');return false;
			}
			var sex = $('input[name="sex"]:checked').val();
			if(sex != 1 && sex != 2){
				layer.msg('请选择主播性别');return false;
			}
			$("#overflow").attr("disabled","disabled");
			layer.load(1, {shade: [0.8, '#393D49']});
		}
</script>
</html>
